using System;
using System.Collections.Generic;
using System.Diagnostics;
using wpffc.contracts.domaindata;

namespace wpffc.flashcardbox
{
    public class Get_next_card : FlashCardBoxEntity
    {
        public void Process(IFlashCardBox box)
        {
            Trace.TraceInformation("Get next card");
            base.boxContainer.Value = box;

            this.Result(box.Batch.Status == BatchStatus.Empty
                            ? new Card { Question = "[Congratulations!]", Answer = "" }
                            : box.Batch.Peek().Card
                       );
        }

        public event Action<Card> Result;
    }
}